import React from 'react'
import { useDispatch } from "umi"
import IconMap from '../IconMap';
import classnames from "classnames";
import "./css/index.less";
// 搜索组件
export default function SearchContainer({ renderForm, closeRight, setcloseRight }) {
    const dispatch = useDispatch();
    return (
        <div className={classnames("filter-wrapper", { "close-right": closeRight })} >
            <div className="filter-title">
                <span>字段过滤</span>
                <span onClick={() => dispatch({
                    type: "common/setIsClearForm",
                    payload: true
                })}>{IconMap.reload}</span>
            </div>
            <div className="filter-container">
                {renderForm()}
            </div>
            <div
                className="close-tip"
                onClick={() => {
                    setcloseRight(!closeRight);
                }}>
                {!closeRight ? IconMap.left : IconMap.right}
            </div>
        </div>
    )
}
